package com.dy.字符串.反转字符串;
/*
反转字符串
编写一个函数，其作用是将输入的字符串反转过来。

示例 1:

输入: "hello"
输出: "olleh"
示例 2:

输入: "A man, a plan, a canal: Panama"
输出: "amanaP :lanac a ,nalp a ,nam A"
 */
public class Solution {
    public static String reverseString(String s) {
        int start = 0;
        int end = s.length()-1;
        char []cs = s.toCharArray();
        while(start <end){

            char tem = cs[start];
            cs[start++] = cs[end];
            cs[end--] = tem;
        }
        return new String(cs);
    }
}
